from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps


class helloRecipe(ConanFile):
    name = "proj1"
    version = "1.0"
    package_type = "application"

    # Optional metadata
    license = "<Put the package license here>"
    author = "<Put your name here> <And your email here>"
    url = "<Package recipe repository url here, for issues about the package>"
    description = "<Description of hello package here>"
    topics = ("<Put some tag here>", "<here>", "<and here>")

    # Binary configuration
    settings = "os", "compiler", "build_type", "arch"
    # options = {}
    # default_options = {"opencv/*:with_tiff":"True"}

    # Sources are located in the same place as this recipe, copy them to the recipe
    exports_sources = "CMakeLists.txt", "src/*"
    requires = "vulkan-headers/1.4.309.0", "glew/2.2.0", "glfw/3.4", "zlib/1.3.1", "libjpeg/9e", "libpng/1.6.44", "boost/1.86.0", "glm/cci.20230113", "assimp/5.4.3"
    # "tinyobjloader/2.0.0-rc10"

    # generators = "CMakeDeps", "CMakeToolchain"
    # tool_requires = "cmake/3.22.6"
    # build_requires = "cmake/3.20.2"


    # def requirements(self):
    #     self.requires("glfw/3.4")
    # def configure(self):
    #     if self.options["dependency1"].cppstd != "11":
    #         raise ConanInvalidConfiguration("Dependency1 requires C++11")
    # def imports(self):
    #     self.copy("*.dll", "", "bin")
    #     self.copy("*.dylib", "", "lib")
    # def deploy(self):
    #     self.copy("*.exe")  # copy from current package
    #     self.copy_deps("*.dll") # copy from dependencies
    
    def layout(self):
        cmake_layout(self)

    def generate(self):
        deps = CMakeDeps(self)
        deps.generate()
        tc = CMakeToolchain(self)
        tc.generate()

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()

    def package(self):
        cmake = CMake(self)
        cmake.install()

    